//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS HealthLake service.
///
/// This is the AWS HealthLake API Reference. For an introduction to the service, see What is AWS HealthLake? in the AWS HealthLake Developer Guide.
public struct HealthLake: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the HealthLake client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            amzTarget: "HealthLake",
            serviceName: "HealthLake",
            serviceIdentifier: "healthlake",
            serviceProtocol: .json(version: "1.0"),
            apiVersion: "2017-07-01",
            endpoint: endpoint,
            errorType: HealthLakeErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Create a FHIR-enabled data store.
    @Sendable
    @inlinable
    public func createFHIRDatastore(_ input: CreateFHIRDatastoreRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateFHIRDatastoreResponse {
        try await self.client.execute(
            operation: "CreateFHIRDatastore", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Create a FHIR-enabled data store.
    ///
    /// Parameters:
    ///   - clientToken: An optional user-provided token to ensure API idempotency.
    ///   - datastoreName: The data store name (user-generated).
    ///   - datastoreTypeVersion: The FHIR release version supported by the data store. Current support is for version R4.
    ///   - identityProviderConfiguration: The identity provider configuration to use for the data store.
    ///   - preloadDataConfig: An optional parameter to preload (import) open source Synthea FHIR data upon creation of the data store.
    ///   - sseConfiguration: The server-side encryption key configuration for a customer-provided encryption key specified for creating a data store.
    ///   - tags: The resource tags applied to a data store when it is created.
    ///   - logger: Logger use during operation
    @inlinable
    public func createFHIRDatastore(
        clientToken: String? = CreateFHIRDatastoreRequest.idempotencyToken(),
        datastoreName: String? = nil,
        datastoreTypeVersion: FHIRVersion,
        identityProviderConfiguration: IdentityProviderConfiguration? = nil,
        preloadDataConfig: PreloadDataConfig? = nil,
        sseConfiguration: SseConfiguration? = nil,
        tags: [Tag]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateFHIRDatastoreResponse {
        let input = CreateFHIRDatastoreRequest(
            clientToken: clientToken, 
            datastoreName: datastoreName, 
            datastoreTypeVersion: datastoreTypeVersion, 
            identityProviderConfiguration: identityProviderConfiguration, 
            preloadDataConfig: preloadDataConfig, 
            sseConfiguration: sseConfiguration, 
            tags: tags
        )
        return try await self.createFHIRDatastore(input, logger: logger)
    }

    /// Delete a FHIR-enabled data store.
    @Sendable
    @inlinable
    public func deleteFHIRDatastore(_ input: DeleteFHIRDatastoreRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteFHIRDatastoreResponse {
        try await self.client.execute(
            operation: "DeleteFHIRDatastore", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Delete a FHIR-enabled data store.
    ///
    /// Parameters:
    ///   - datastoreId:  The AWS-generated identifier for the data store to be deleted.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteFHIRDatastore(
        datastoreId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteFHIRDatastoreResponse {
        let input = DeleteFHIRDatastoreRequest(
            datastoreId: datastoreId
        )
        return try await self.deleteFHIRDatastore(input, logger: logger)
    }

    /// Get properties for a FHIR-enabled data store.
    @Sendable
    @inlinable
    public func describeFHIRDatastore(_ input: DescribeFHIRDatastoreRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeFHIRDatastoreResponse {
        try await self.client.execute(
            operation: "DescribeFHIRDatastore", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Get properties for a FHIR-enabled data store.
    ///
    /// Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeFHIRDatastore(
        datastoreId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeFHIRDatastoreResponse {
        let input = DescribeFHIRDatastoreRequest(
            datastoreId: datastoreId
        )
        return try await self.describeFHIRDatastore(input, logger: logger)
    }

    /// Get FHIR export job properties.
    @Sendable
    @inlinable
    public func describeFHIRExportJob(_ input: DescribeFHIRExportJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeFHIRExportJobResponse {
        try await self.client.execute(
            operation: "DescribeFHIRExportJob", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Get FHIR export job properties.
    ///
    /// Parameters:
    ///   - datastoreId: The data store identifier from which FHIR data is being exported from.
    ///   - jobId: The export job identifier.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeFHIRExportJob(
        datastoreId: String,
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeFHIRExportJobResponse {
        let input = DescribeFHIRExportJobRequest(
            datastoreId: datastoreId, 
            jobId: jobId
        )
        return try await self.describeFHIRExportJob(input, logger: logger)
    }

    /// Get the import job properties to learn more about the job or job progress.
    @Sendable
    @inlinable
    public func describeFHIRImportJob(_ input: DescribeFHIRImportJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeFHIRImportJobResponse {
        try await self.client.execute(
            operation: "DescribeFHIRImportJob", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Get the import job properties to learn more about the job or job progress.
    ///
    /// Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - jobId: The import job identifier.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeFHIRImportJob(
        datastoreId: String,
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeFHIRImportJobResponse {
        let input = DescribeFHIRImportJobRequest(
            datastoreId: datastoreId, 
            jobId: jobId
        )
        return try await self.describeFHIRImportJob(input, logger: logger)
    }

    /// List all FHIR-enabled data stores in a user’s account, regardless of data store status.
    @Sendable
    @inlinable
    public func listFHIRDatastores(_ input: ListFHIRDatastoresRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListFHIRDatastoresResponse {
        try await self.client.execute(
            operation: "ListFHIRDatastores", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// List all FHIR-enabled data stores in a user’s account, regardless of data store status.
    ///
    /// Parameters:
    ///   - filter: List all filters associated with a FHIR data store request.
    ///   - maxResults: The maximum number of data stores returned on a page.
    ///   - nextToken: The token used to retrieve the next page of data stores when results are paginated.
    ///   - logger: Logger use during operation
    @inlinable
    public func listFHIRDatastores(
        filter: DatastoreFilter? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListFHIRDatastoresResponse {
        let input = ListFHIRDatastoresRequest(
            filter: filter, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listFHIRDatastores(input, logger: logger)
    }

    /// Lists all FHIR export jobs associated with an account and their statuses.
    @Sendable
    @inlinable
    public func listFHIRExportJobs(_ input: ListFHIRExportJobsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListFHIRExportJobsResponse {
        try await self.client.execute(
            operation: "ListFHIRExportJobs", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all FHIR export jobs associated with an account and their statuses.
    ///
    /// Parameters:
    ///   - datastoreId: Limits the response to the export job with the specified data store ID.
    ///   - jobName: Limits the response to the export job with the specified job name.
    ///   - jobStatus: Limits the response to export jobs with the specified job status.
    ///   - maxResults: Limits the number of results returned for a ListFHIRExportJobs to a maximum quantity specified by the user.
    ///   - nextToken: A pagination token used to identify the next page of results to return.
    ///   - submittedAfter: Limits the response to FHIR export jobs submitted after a user-specified date.
    ///   - submittedBefore: Limits the response to FHIR export jobs submitted before a user- specified date.
    ///   - logger: Logger use during operation
    @inlinable
    public func listFHIRExportJobs(
        datastoreId: String,
        jobName: String? = nil,
        jobStatus: JobStatus? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        submittedAfter: Date? = nil,
        submittedBefore: Date? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListFHIRExportJobsResponse {
        let input = ListFHIRExportJobsRequest(
            datastoreId: datastoreId, 
            jobName: jobName, 
            jobStatus: jobStatus, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            submittedAfter: submittedAfter, 
            submittedBefore: submittedBefore
        )
        return try await self.listFHIRExportJobs(input, logger: logger)
    }

    /// List all FHIR import jobs associated with an account and their statuses.
    @Sendable
    @inlinable
    public func listFHIRImportJobs(_ input: ListFHIRImportJobsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListFHIRImportJobsResponse {
        try await self.client.execute(
            operation: "ListFHIRImportJobs", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// List all FHIR import jobs associated with an account and their statuses.
    ///
    /// Parameters:
    ///   - datastoreId: Limits the response to the import job with the specified data store ID.
    ///   - jobName: Limits the response to the import job with the specified job name.
    ///   - jobStatus: Limits the response to the import job with the specified job status.
    ///   - maxResults: Limits the number of results returned for ListFHIRImportJobs to a maximum quantity specified by the user.
    ///   - nextToken: The pagination token used to identify the next page of results to return.
    ///   - submittedAfter: Limits the response to FHIR import jobs submitted after a user-specified date.
    ///   - submittedBefore: Limits the response to FHIR import jobs submitted before a user- specified date.
    ///   - logger: Logger use during operation
    @inlinable
    public func listFHIRImportJobs(
        datastoreId: String,
        jobName: String? = nil,
        jobStatus: JobStatus? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        submittedAfter: Date? = nil,
        submittedBefore: Date? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListFHIRImportJobsResponse {
        let input = ListFHIRImportJobsRequest(
            datastoreId: datastoreId, 
            jobName: jobName, 
            jobStatus: jobStatus, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            submittedAfter: submittedAfter, 
            submittedBefore: submittedBefore
        )
        return try await self.listFHIRImportJobs(input, logger: logger)
    }

    /// Returns a list of all existing tags associated with a data store.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a list of all existing tags associated with a data store.
    ///
    /// Parameters:
    ///   - resourceARN: The Amazon Resource Name (ARN) of the data store to which tags are being added.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceARN: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceARN: resourceARN
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Start a FHIR export job.
    @Sendable
    @inlinable
    public func startFHIRExportJob(_ input: StartFHIRExportJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartFHIRExportJobResponse {
        try await self.client.execute(
            operation: "StartFHIRExportJob", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Start a FHIR export job.
    ///
    /// Parameters:
    ///   - clientToken: An optional user provided token used for ensuring API idempotency.
    ///   - dataAccessRoleArn: The Amazon Resource Name (ARN) used during initiation of the export job.
    ///   - datastoreId: The data store identifier from which files are being exported.
    ///   - jobName: The export job name.
    ///   - outputDataConfig: The output data configuration supplied when the export job was started.
    ///   - logger: Logger use during operation
    @inlinable
    public func startFHIRExportJob(
        clientToken: String? = StartFHIRExportJobRequest.idempotencyToken(),
        dataAccessRoleArn: String,
        datastoreId: String,
        jobName: String? = nil,
        outputDataConfig: OutputDataConfig,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartFHIRExportJobResponse {
        let input = StartFHIRExportJobRequest(
            clientToken: clientToken, 
            dataAccessRoleArn: dataAccessRoleArn, 
            datastoreId: datastoreId, 
            jobName: jobName, 
            outputDataConfig: outputDataConfig
        )
        return try await self.startFHIRExportJob(input, logger: logger)
    }

    /// Start importing bulk FHIR data into an ACTIVE data store. The import job imports FHIR data found in the InputDataConfig object and stores processing results in the JobOutputDataConfig object.
    @Sendable
    @inlinable
    public func startFHIRImportJob(_ input: StartFHIRImportJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartFHIRImportJobResponse {
        try await self.client.execute(
            operation: "StartFHIRImportJob", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Start importing bulk FHIR data into an ACTIVE data store. The import job imports FHIR data found in the InputDataConfig object and stores processing results in the JobOutputDataConfig object.
    ///
    /// Parameters:
    ///   - clientToken: The optional user-provided token used for ensuring API idempotency.
    ///   - dataAccessRoleArn: The Amazon Resource Name (ARN) that grants access permission to AWS HealthLake.
    ///   - datastoreId: The data store identifier.
    ///   - inputDataConfig: The input properties for the import job request.
    ///   - jobName: The import job name.
    ///   - jobOutputDataConfig: 
    ///   - validationLevel: The validation level of the import job.
    ///   - logger: Logger use during operation
    @inlinable
    public func startFHIRImportJob(
        clientToken: String? = StartFHIRImportJobRequest.idempotencyToken(),
        dataAccessRoleArn: String,
        datastoreId: String,
        inputDataConfig: InputDataConfig,
        jobName: String? = nil,
        jobOutputDataConfig: OutputDataConfig,
        validationLevel: ValidationLevel? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartFHIRImportJobResponse {
        let input = StartFHIRImportJobRequest(
            clientToken: clientToken, 
            dataAccessRoleArn: dataAccessRoleArn, 
            datastoreId: datastoreId, 
            inputDataConfig: inputDataConfig, 
            jobName: jobName, 
            jobOutputDataConfig: jobOutputDataConfig, 
            validationLevel: validationLevel
        )
        return try await self.startFHIRImportJob(input, logger: logger)
    }

    /// Add a user-specifed key and value tag to a data store.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Add a user-specifed key and value tag to a data store.
    ///
    /// Parameters:
    ///   - resourceARN: The Amazon Resource Name (ARN) that grants access to the data store tags are being added to.
    ///   - tags: The user-specified key and value pair tags being added to a data store.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceARN: String,
        tags: [Tag],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceARN: resourceARN, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Remove a user-specifed key and value tag from a data store.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Remove a user-specifed key and value tag from a data store.
    ///
    /// Parameters:
    ///   - resourceARN: The Amazon Resource Name (ARN) of the data store from which tags are being removed.
    ///   - tagKeys: The keys for the tags to be removed from the data store.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceARN: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceARN: resourceARN, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }
}

extension HealthLake {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: HealthLake, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension HealthLake {
    /// Return PaginatorSequence for operation ``listFHIRDatastores(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listFHIRDatastoresPaginator(
        _ input: ListFHIRDatastoresRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListFHIRDatastoresRequest, ListFHIRDatastoresResponse> {
        return .init(
            input: input,
            command: self.listFHIRDatastores,
            inputKey: \ListFHIRDatastoresRequest.nextToken,
            outputKey: \ListFHIRDatastoresResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listFHIRDatastores(_:logger:)``.
    ///
    /// - Parameters:
    ///   - filter: List all filters associated with a FHIR data store request.
    ///   - maxResults: The maximum number of data stores returned on a page.
    ///   - logger: Logger used for logging
    @inlinable
    public func listFHIRDatastoresPaginator(
        filter: DatastoreFilter? = nil,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListFHIRDatastoresRequest, ListFHIRDatastoresResponse> {
        let input = ListFHIRDatastoresRequest(
            filter: filter, 
            maxResults: maxResults
        )
        return self.listFHIRDatastoresPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listFHIRExportJobs(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listFHIRExportJobsPaginator(
        _ input: ListFHIRExportJobsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListFHIRExportJobsRequest, ListFHIRExportJobsResponse> {
        return .init(
            input: input,
            command: self.listFHIRExportJobs,
            inputKey: \ListFHIRExportJobsRequest.nextToken,
            outputKey: \ListFHIRExportJobsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listFHIRExportJobs(_:logger:)``.
    ///
    /// - Parameters:
    ///   - datastoreId: Limits the response to the export job with the specified data store ID.
    ///   - jobName: Limits the response to the export job with the specified job name.
    ///   - jobStatus: Limits the response to export jobs with the specified job status.
    ///   - maxResults: Limits the number of results returned for a ListFHIRExportJobs to a maximum quantity specified by the user.
    ///   - submittedAfter: Limits the response to FHIR export jobs submitted after a user-specified date.
    ///   - submittedBefore: Limits the response to FHIR export jobs submitted before a user- specified date.
    ///   - logger: Logger used for logging
    @inlinable
    public func listFHIRExportJobsPaginator(
        datastoreId: String,
        jobName: String? = nil,
        jobStatus: JobStatus? = nil,
        maxResults: Int? = nil,
        submittedAfter: Date? = nil,
        submittedBefore: Date? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListFHIRExportJobsRequest, ListFHIRExportJobsResponse> {
        let input = ListFHIRExportJobsRequest(
            datastoreId: datastoreId, 
            jobName: jobName, 
            jobStatus: jobStatus, 
            maxResults: maxResults, 
            submittedAfter: submittedAfter, 
            submittedBefore: submittedBefore
        )
        return self.listFHIRExportJobsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listFHIRImportJobs(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listFHIRImportJobsPaginator(
        _ input: ListFHIRImportJobsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListFHIRImportJobsRequest, ListFHIRImportJobsResponse> {
        return .init(
            input: input,
            command: self.listFHIRImportJobs,
            inputKey: \ListFHIRImportJobsRequest.nextToken,
            outputKey: \ListFHIRImportJobsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listFHIRImportJobs(_:logger:)``.
    ///
    /// - Parameters:
    ///   - datastoreId: Limits the response to the import job with the specified data store ID.
    ///   - jobName: Limits the response to the import job with the specified job name.
    ///   - jobStatus: Limits the response to the import job with the specified job status.
    ///   - maxResults: Limits the number of results returned for ListFHIRImportJobs to a maximum quantity specified by the user.
    ///   - submittedAfter: Limits the response to FHIR import jobs submitted after a user-specified date.
    ///   - submittedBefore: Limits the response to FHIR import jobs submitted before a user- specified date.
    ///   - logger: Logger used for logging
    @inlinable
    public func listFHIRImportJobsPaginator(
        datastoreId: String,
        jobName: String? = nil,
        jobStatus: JobStatus? = nil,
        maxResults: Int? = nil,
        submittedAfter: Date? = nil,
        submittedBefore: Date? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListFHIRImportJobsRequest, ListFHIRImportJobsResponse> {
        let input = ListFHIRImportJobsRequest(
            datastoreId: datastoreId, 
            jobName: jobName, 
            jobStatus: jobStatus, 
            maxResults: maxResults, 
            submittedAfter: submittedAfter, 
            submittedBefore: submittedBefore
        )
        return self.listFHIRImportJobsPaginator(input, logger: logger)
    }
}

extension HealthLake.ListFHIRDatastoresRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> HealthLake.ListFHIRDatastoresRequest {
        return .init(
            filter: self.filter,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension HealthLake.ListFHIRExportJobsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> HealthLake.ListFHIRExportJobsRequest {
        return .init(
            datastoreId: self.datastoreId,
            jobName: self.jobName,
            jobStatus: self.jobStatus,
            maxResults: self.maxResults,
            nextToken: token,
            submittedAfter: self.submittedAfter,
            submittedBefore: self.submittedBefore
        )
    }
}

extension HealthLake.ListFHIRImportJobsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> HealthLake.ListFHIRImportJobsRequest {
        return .init(
            datastoreId: self.datastoreId,
            jobName: self.jobName,
            jobStatus: self.jobStatus,
            maxResults: self.maxResults,
            nextToken: token,
            submittedAfter: self.submittedAfter,
            submittedBefore: self.submittedBefore
        )
    }
}

// MARK: Waiters

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension HealthLake {
    /// Waiter for operation ``describeFHIRDatastore(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilFHIRDatastoreActive(
        _ input: DescribeFHIRDatastoreRequest,
        maxWaitTime: TimeAmount? = nil,
        logger: Logger = AWSClient.loggingDisabled
    ) async throws {
        let waiter = AWSClient.Waiter<DescribeFHIRDatastoreRequest, _>(
            acceptors: [
                .init(state: .success, matcher: try! JMESPathMatcher("datastoreProperties.datastoreStatus", expected: "ACTIVE")),
                .init(state: .failure, matcher: try! JMESPathMatcher("datastoreProperties.datastoreStatus", expected: "CREATE_FAILED")),
                .init(state: .failure, matcher: try! JMESPathMatcher("datastoreProperties.datastoreStatus", expected: "DELETED")),
            ],
            minDelayTime: .seconds(60),
            command: self.describeFHIRDatastore
        )
        return try await self.client.waitUntil(input, waiter: waiter, maxWaitTime: maxWaitTime, logger: logger)
    }
    /// Waiter for operation ``describeFHIRDatastore(_:logger:)``.
    ///
    /// - Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilFHIRDatastoreActive(
        datastoreId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DescribeFHIRDatastoreRequest(
            datastoreId: datastoreId
        )
        try await self.waitUntilFHIRDatastoreActive(input, logger: logger)
    }

    /// Waiter for operation ``describeFHIRDatastore(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilFHIRDatastoreDeleted(
        _ input: DescribeFHIRDatastoreRequest,
        maxWaitTime: TimeAmount? = nil,
        logger: Logger = AWSClient.loggingDisabled
    ) async throws {
        let waiter = AWSClient.Waiter<DescribeFHIRDatastoreRequest, _>(
            acceptors: [
                .init(state: .success, matcher: try! JMESPathMatcher("datastoreProperties.datastoreStatus", expected: "DELETED")),
            ],
            minDelayTime: .seconds(120),
            command: self.describeFHIRDatastore
        )
        return try await self.client.waitUntil(input, waiter: waiter, maxWaitTime: maxWaitTime, logger: logger)
    }
    /// Waiter for operation ``describeFHIRDatastore(_:logger:)``.
    ///
    /// - Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilFHIRDatastoreDeleted(
        datastoreId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DescribeFHIRDatastoreRequest(
            datastoreId: datastoreId
        )
        try await self.waitUntilFHIRDatastoreDeleted(input, logger: logger)
    }

    /// Waiter for operation ``describeFHIRExportJob(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilFHIRExportJobCompleted(
        _ input: DescribeFHIRExportJobRequest,
        maxWaitTime: TimeAmount? = nil,
        logger: Logger = AWSClient.loggingDisabled
    ) async throws {
        let waiter = AWSClient.Waiter<DescribeFHIRExportJobRequest, _>(
            acceptors: [
                .init(state: .success, matcher: try! JMESPathMatcher("exportJobProperties.jobStatus", expected: "COMPLETED")),
                .init(state: .success, matcher: try! JMESPathMatcher("exportJobProperties.jobStatus", expected: "COMPLETED_WITH_ERRORS")),
                .init(state: .failure, matcher: try! JMESPathMatcher("exportJobProperties.jobStatus", expected: "CANCEL_COMPLETED")),
                .init(state: .failure, matcher: try! JMESPathMatcher("exportJobProperties.jobStatus", expected: "FAILED")),
                .init(state: .failure, matcher: try! JMESPathMatcher("exportJobProperties.jobStatus", expected: "CANCEL_FAILED")),
            ],
            minDelayTime: .seconds(120),
            command: self.describeFHIRExportJob
        )
        return try await self.client.waitUntil(input, waiter: waiter, maxWaitTime: maxWaitTime, logger: logger)
    }
    /// Waiter for operation ``describeFHIRExportJob(_:logger:)``.
    ///
    /// - Parameters:
    ///   - datastoreId: The data store identifier from which FHIR data is being exported from.
    ///   - jobId: The export job identifier.
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilFHIRExportJobCompleted(
        datastoreId: String,
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DescribeFHIRExportJobRequest(
            datastoreId: datastoreId, 
            jobId: jobId
        )
        try await self.waitUntilFHIRExportJobCompleted(input, logger: logger)
    }

    /// Waiter for operation ``describeFHIRImportJob(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilFHIRImportJobCompleted(
        _ input: DescribeFHIRImportJobRequest,
        maxWaitTime: TimeAmount? = nil,
        logger: Logger = AWSClient.loggingDisabled
    ) async throws {
        let waiter = AWSClient.Waiter<DescribeFHIRImportJobRequest, _>(
            acceptors: [
                .init(state: .success, matcher: try! JMESPathMatcher("importJobProperties.jobStatus", expected: "COMPLETED")),
                .init(state: .success, matcher: try! JMESPathMatcher("importJobProperties.jobStatus", expected: "COMPLETED_WITH_ERRORS")),
                .init(state: .failure, matcher: try! JMESPathMatcher("importJobProperties.jobStatus", expected: "FAILED")),
            ],
            minDelayTime: .seconds(120),
            command: self.describeFHIRImportJob
        )
        return try await self.client.waitUntil(input, waiter: waiter, maxWaitTime: maxWaitTime, logger: logger)
    }
    /// Waiter for operation ``describeFHIRImportJob(_:logger:)``.
    ///
    /// - Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - jobId: The import job identifier.
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilFHIRImportJobCompleted(
        datastoreId: String,
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DescribeFHIRImportJobRequest(
            datastoreId: datastoreId, 
            jobId: jobId
        )
        try await self.waitUntilFHIRImportJobCompleted(input, logger: logger)
    }
}
